<?php
if ($post_data -> num_rows() <= 0) {
	redirect("manage-posts");
}

$desc = $post_data -> row() -> description;
$img = $post_data -> row() -> img_name;
$img_path = $post_data -> row() -> img_path;
?>
		<div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header"><i class="fa fa-user fa-fw"></i> <?php echo $this -> lang -> line('title_update_post'); ?></h1>
                </div>
                <!-- /.col-lg-12 -->
            </div>
<form class="form-horizontal" method="post" action="<?php echo base_url(); ?>manage-posts/update-post/<?php echo $this -> uri -> segment(3); ?>" enctype="multipart/form-data">	
		<div class="row">
                <div class="col-lg-12">
                	<?php
					//$this->load->view('help/notifications');
                    ?>
                    <div class="panel panel-default">
                        <div class="panel-heading">
                          <?php echo $this -> lang -> line('title_dashboard'); ?> >> <?php echo $this -> lang -> line('title_update_post'); ?>
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body form-horizontal">
				
							<!-- Text input-->
							<div class="form-group">
								<label class="col-md-4 control-label" for="tag_name"><?php echo $this -> lang -> line('form_label_tag_name'); ?> <span class="star_require">*</span></label>
								<div class="col-md-5">
									<select name="tag_name" class="form-control">
										<?php echo $dropdown_tags_selected; ?>
									</select>
									<span class="help-block"><?php echo form_error('tag_name'); ?></span>
								</div>
							</div>
							<!-- Text input-->
							<div class="form-group">
								<label class="col-md-4 control-label" for="userfile"><?php echo $this -> lang -> line('form_label_upd_image'); ?> </label>
								<div class="col-md-5">
									<input id="userfile" name="userfile"  class="form-control input-md" type="file">
									<span class="help-block"><?php
										if (isset($error)) { echo $error;
										}
									?></span>
								</div>
							</div>
							
							<!-- Text input-->
							<div class="form-group">
								<label class="col-md-4 control-label" for="userfile">&nbsp; </label>
								<div class="col-md-5">
									<?php
										if($img!=""){
									?>
											<img src="<?php echo base_url() . F_IMG . "tags/" . $img; ?>" width="280" />
									<?php
												}
									?>
									
									
								</div>
							</div>
							<!-- Text input-->
							<div class="form-group">
								<label class="col-md-4 control-label" for="description"><?php echo $this -> lang -> line('form_label_description'); ?> <span class="star_require">*</span></label>
								<div class="col-md-5">
									<textarea name="description" rows="10" class="form-control"><?php echo $desc; ?></textarea>
									<span class="help-block"><?php echo form_error('description'); ?></span>
								</div>
							</div>
														
                         </div>
                    </div>
                </div>
           </div>
           
           
           
           <div class="row"><!-- Button (Double) -->
							
                <div class="col-lg-12">
                    	<div class="form-group">
								<label class="col-md-4 control-label" for="submit"></label>
								<div class="col-md-8">
									<button id="submit" name="submit" class="btn btn-success" type="submit">
										<i class="fa fa-save fa-fw"></i>
										<?php echo $this -> lang -> line('button_update'); ?>
									</button>
									<button id="clear" name="clear" class="btn btn-warning" type="button" onclick="goBack()">
										<i class="fa fa-repeat fa-fw"></i>
										<?php echo $this -> lang -> line('button_cancel'); ?>
									</button>
								</div>
							</div>
                </div>
                <!-- /.col-lg-12 -->
            </div>
</form>                   	
			